package vista.treeDiagrama;

import java.awt.event.MouseListener;

import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.border.BevelBorder;

import vista.PathIconos;
import vista.UtilVista;

@SuppressWarnings("serial")
public class PopupMenuEditar extends JPopupMenu {

	private JMenuItem opEditar;
	
	public PopupMenuEditar()
	{
		super();

		setBorder(new BevelBorder(BevelBorder.RAISED));

		agregarItemsPrevios();
		
		opEditar = new JMenuItem("Editar", UtilVista.cargarIcono(getClass().getResource(PathIconos.IMAGEN_POPUPMENU_EDITAR)));
		opEditar.setHorizontalTextPosition(JMenuItem.RIGHT);
		this.add(opEditar);	
	}
	
	protected void agregarItemsPrevios(){	}
	
	public void escucharEventoEditar(MouseListener controlador)
	{
		opEditar.addMouseListener(controlador);
	}
	
//
//	// An inner class to show when popup events occur
//	class PopupPrintListener implements PopupMenuListener {
//	 public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
//	   System.out.println("Popup menu will be visible!");
//	 }
//	
//	 public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
//	   System.out.println("Popup menu will be invisible!");
//	 }
//	
//	 public void popupMenuCanceled(PopupMenuEvent e) {
//	   System.out.println("Popup menu is hidden!");
//	 }
//	}
//	

}
